<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var fruit = prompt('请输入水果名称');
    switch (fruit) {
        case '香蕉':
            alert('香蕉的价格是3.5元一斤');
            break;
        case '火龙果':
            alert('火龙果的价格是15元一斤');
            break;
        default:
            alert('没有此水果')
    }
</script>

</html>